import HttpRequest from '@/api/request';
import ApiConfig from '@/api/api-config';

// 全宗联想
const getKeyName = option => {
    let url = ApiConfig.indexSearchUrl;
    return HttpRequest.requestJsonPost(url,option)
};

// 展示常用文档和通知
const getDownloadFile = option => {
    let url = ApiConfig.messagerDocumentUrl;
    return HttpRequest.requestJsonPost(url,option)
};

/*// 下载文档
const downloadFile = option => {
    let url = ApiConfig.indexDownLoad;
    return HttpRequest.requestBlobGet1(url,option)
};*/

// 下载文档
function downloadFile(params){
    let url = ApiConfig.downloadCommonFile;
    return HttpRequest.requestBlobGetFile(url, params)
}
const cinemaPage = option => {
    let url = ApiConfig.cinemaPage;
    return HttpRequest.requestJsonPost(url,option)
};

const device = option => {
    let url = ApiConfig.device;
    return HttpRequest.requestJsonPost(url,option)
};
const hall = option => {
    let url = ApiConfig.hall;
    return HttpRequest.requestJsonPost(url,option)
};
// 获取影院详细信息和Tms信息
function findByPropertyCode(data) {
    let url = ApiConfig.findByPropertyCode;
    return HttpRequest.requestFormPost(url+'?cinemaCode='+data)
} 
//总部确认列表
function flmList(option) {
    let url = ApiConfig.flmList;
    return HttpRequest.requestJsonPost(url,option)
};
function flmListTask(option) {
    let url = ApiConfig.flmListTask;
    return HttpRequest.requestJsonPost(url,option)
};
function flmRepeatSync(option) {
    let url = ApiConfig.flmRepeatSync;
    return HttpRequest.requestJsonPost(url,option)
};
function flmDetail(option) {
    let url = ApiConfig.flmDetail;
    return HttpRequest.requestJsonPost(url,option)
};
function flmConfirm(option) {
    let url = ApiConfig.flmConfirm;
    return HttpRequest.requestJsonPost(url,option)
};
function flmDetailHall(option) {
    let url = ApiConfig.flmDetailHall;
    return HttpRequest.requestJsonPost(url,option)
};
let Service = {
    getKeyName,
    getDownloadFile,
    downloadFile,
    cinemaPage,
    device,
    hall,
    findByPropertyCode,
    flmList, //总部确认列表
    flmListTask,
    flmRepeatSync,
    flmDetail,
    flmConfirm,
    flmDetailHall,
};

export default Service;